<?php echo $this->fetch('header.html'); ?>
<div class="row">
	<div class="span12">
    <ul class="nav nav-tabs">
    	<li class="active"><a href="<?php echo $this->_var['appadmin']; ?>?m=user">用户管理</a></li>
        <li><a href="<?php echo $this->_var['appadmin']; ?>?m=user&a=add">用户添加</a></li>
    </ul>
    <h3><small>共<?php echo $this->_var['rscount']; ?>条记录</small></h3>
    <div>
    <form method="get" action="<?php echo $this->_var['appadmin']; ?>" class="form form-inline">
    <input type="hidden" name="m" value="user" />
    userid:<input type="text" name="userid" value="<?php echo intval($_GET['userid']); ?>" style="width:50px" />
    昵称：<input type="text" name="nickname" value="<?php echo $_GET['nickname']; ?>" />
    排序：<select name="orderby">
    	<option value="userid DESC">注册</option>
    	<option value="money DESC">余额</option>
        <option value="gold DESC">金币</option>
        <option value="grade DESC">积分</option>
    </select>
    <input type="submit" value="搜索" class="btn btn-success" />
    </form>
    </div>
    <table class="table table-bordered" width="100%">
    	<tr>
        <td width="11%">ID</td>
        <td>账号</td>
        <td width="17%">昵称</td>
        <td>电话</td>
        <td width="10%">账户余额</td>
        <td width="8%">金币</td>
        <td width="8%">积分</td>
        <td width="10%">状态</td>
        <td>注册时间</td>
        <td width="10%">类型</td>
        <td width="100 ">操作</td>
        </tr>
       <?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
       <tr>
        <td><?php echo $this->_var['c']['userid']; ?></td>
        <td><?php echo $this->_var['c']['username']; ?></td>
        <td><?php echo $this->_var['c']['nickname']; ?></td>
        <td><?php echo $this->_var['c']['telephone']; ?></td>
        <td><?php echo $this->_var['c']['money']; ?></td>
        <td width="8%"><?php echo $this->_var['c']['gold']; ?></td>
        <td width="8%"><?php echo $this->_var['c']['grade']; ?></td>
        <td><?php if ($this->_var['c']['status'] == 1): ?>已通过<?php elseif ($this->_var['c']['status'] == 10): ?>未审核<?php else: ?>已禁止<?php endif; ?></td>
        <td><?php echo date("Y-m-d",$this->_var['c']['dateline']); ?></td>
        <td><?php echo $this->_var['user_type_list'][$this->_var['c']['user_type']]; ?></td>
        <td> <a href="<?php echo APPADMIN; ?>?m=user&a=add&userid=<?php echo $this->_var['c']['userid']; ?>">编辑</a>  
        <a href="javascript:;" class="setLogin" url="<?php echo APPADMIN; ?>?m=user&a=login&userid=<?php echo $this->_var['c']['userid']; ?>&ajax=1" >切换登陆</a>
        <br>
        <a href="<?php echo APPADMIN; ?>?m=recharge&a=man&userid=<?php echo $this->_var['c']['userid']; ?>" >充值</a>
        <a href="<?php echo APPADMIN; ?>?m=gold_log&a=man&userid=<?php echo $this->_var['c']['userid']; ?>">充积分</a>
        </td>
        </tr>
       <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> 
    
    </table>
    <?php echo $this->_var['pagelist']; ?>
    </div>
</div>
<script>
$(function(){
	$(".setLogin").on("click",function(){
		$.get($(this).attr("url"),function(data){
			skyToast('切换登录成功');
		});
	});
})
</script>
<?php echo $this->fetch('footer.html'); ?>